package com.hzw.saas.api.product.dto;

import java.util.Date;
import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzw.saas.common.util.constants.PatternConsts;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author zzl
 * @since 04/08/2021
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "用户产品许可配置")
public class LicenseUserBO {

    @NotBlank(message = "产品许可ID不可为空")
    @ApiModelProperty(value = "产品许可ID")
    private String licenseId;

    @NotBlank(message = "产品ID不可为空")
    @ApiModelProperty(value = "产品ID")
    private String productId;

    @NotBlank(message = "用户账户ID不可为空")
    @ApiModelProperty(value = "用户账户ID")
    private String userId;

    @ApiModelProperty(value = "产品版本号", hidden = true)
    private String productVersion;

    @ApiModelProperty(value = "允许使用的最大CPU核数", hidden = true)
    private Integer maxCpuCore;

    @ApiModelProperty(value = "允许使用的最大内存单位G", hidden = true)
    private Integer maxMemory;

    @ApiModelProperty(value = "授权控制, 1-GUI界面，2-本地计算，4-远程计算; 数字可以组合, 比如3表示GUI+本地计算")
    private Integer parallelModel;

    @ApiModelProperty(value = "产品类型, 0-单机, 1-一体机, 2-局域网hpc, 3-超算中心", hidden = true)
    private Integer productType;

    @ApiModelProperty(value = "是否超算用户, 0-不是, 1-是", hidden = true)
    private Integer hpcUser;

    @ApiModelProperty(value = "产品使用起始日期, pattern=" + PatternConsts.NORM_DATE_PATTERN)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date validatedEffectiveDate;

    @ApiModelProperty(value = "产品使用截止日期, pattern=" + PatternConsts.NORM_DATE_PATTERN)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date validatedExpiredDate;

    @ApiModelProperty(value = "产品运维起始日期, pattern=" + PatternConsts.NORM_DATE_PATTERN)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maintenanceEffectiveDate;

    @ApiModelProperty(value = "产品运维起始日期, pattern=" + PatternConsts.NORM_DATE_PATTERN)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maintenanceExpiredDate;

}
